#function sayHello()
#{
#	if($args.Count -eq 0)
#	{
#		"No argument!"
#	}
#	else
#	{
#		$args | foreach{"Hello, $($_)"}
#	}
#}

#sayHello tom

#function Add
#{
#	$sum=0
#	$args|foreach{$sum=$sum+$_}

#	$sum
#}

#Add 1 2 3


#function stringContact($str1,$str2)
#{
#	return $str1+$str2
#}

#stringContact moss fly
#stringContact -str1 word -str2 press

#function stringContact($str1="moss",$str2="fly")
#{
#	return $str1+$str2
#}

#stringContact

#function substract([int]$value1,[int]$value2)
#{
#	return $value1-$value2
#}

#substract 4 1

#function dayOfWeek([datetime]$date)
#{
#	return $date.DayOfWeek
#}

#dayOfWeek '2014-1-2'

#function tryReverse([switch]$try,[string]$source)
#{
#	[string]$target=""
#	if($try)
#	{
#		for([int]$i=$source.Length-1;$i -ge 0;$i--)
#		{
#			$target+=$source[$i]
#		}
#		return $target
#	}
#	return $source
#}

#tryReverse -source www.mossfly.com
#tryReverse -try $true -source www.mossfly.com


function Add1([int]$value1=1,[int]$value2=2)
{
	return $value1+$value2
}

Add1 
Add1 1 4
Add1 -value1 10 -value2 2

function Add2
{
	param([int]$value1=1,[int]$value2=2)

	return $value1+$value2
}

Add2
Add2 -value1 10 -value2 10
